package com.tzy.rabbitmq.publish_subscribe;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.tzy.rabbitmq.constant.RabbitmqConstant;
import com.tzy.rabbitmq.utils.RabbitmqUtil;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
/**
 * @Author 自律且自强ing
 * @Created 2022/8/3 15:32
 */
public class Baidu {
    public static void main(String[] args) throws IOException, TimeoutException {
        //获取TCP长连接
        Connection connection = RabbitmqUtil.getConnection();

        //获取虚拟连接 | 创建频道/通道
        final Channel channel = connection.createChannel();
        ///声明队列信息
        channel.queueDeclare();
        //queueBind用于将队列与交换机绑定
        //参数一:队列名; 参数二:交换机名; 参数三:路由Key (暂时用不到)
        channel.queueBind(RabbitmqConstant.QUEUE_BAIDU, RabbitmqConstant.EXCHANGE_WEATHER, "");

    }
}
